package top.jiangqiang.qianyi.common.auth;

import lombok.Data;
import lombok.RequiredArgsConstructor;
import top.jiangqiang.qianyi.common.constants.auth.Platform;
import top.jiangqiang.qianyi.common.utils.JsonUtil;

@Data
@RequiredArgsConstructor
public class TokenPlayLoad {
    /**
     * 账号ID，前台账号表的ID或者后台账号表的ID
     */
    private final Long userId;
    /**
     * 登录时间，用于判断该token是否被下线
     */
    private final Long loginTime = System.currentTimeMillis();
    /**
     * 登录平台
     */
    private final Platform platform;

    @Override
    public String toString() {
        return JsonUtil.toJsonStr(this);
    }

}
